<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GMLAS - Metadata layers</title>

<style type="text/css">
table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
}
th, td {
    padding: 5px;
}
</style>

</head>

<body>

<h1>GMLAS - Metadata layers</h1>

<p>This page details the structure of the extra metadata layers reported by
the <a href="drv_gmlas.html">GMLAS</a> driver.</p>

<h3>_ogr_fields_metadata layer</h3>

<p>This layer gives metadata about OGR fields, and also "abstract" fields
that describe the relation ship between a parent and child layer.</p>

<p>Its structure is:
<br/>
<br/>
</p>
<table>
<tr><th>Field name</th><th>Description</th></tr>
<tr><td>layer_name</td><td>Name of the layer to which the field belongs to</td></tr>
<tr><td>field_name</td><td>Name of the field. May be null when field_category is
PATH_TO_CHILD_ELEMENT_NO_LINK or GROUP</td></tr>
<tr><td>field_xpath</td><td>XPath of the element/attribute whose content is used
for the field. The XPath is relative to the element that is the direct parent
of this element/attribute, or a parent element in case of flattening. May be
null for a field generated by OGR.</td></tr>
<tr><td>field_type</td><td>the XML schema base data type (string, int, long, ID, ...).
Extended with "geometry". May be null for a field generated by OGR</td></tr>
<tr><td>field_is_list</td><td>Whether the XML type is a list.</td></tr>
<tr><td>field_min_occurs</td><td>Integer value with the minimum number of occurrences
of values. 0 or 1 typically. Or more for array types. May be
null for a field generated by OGR</td></tr>
<tr><td>field_max_occurs</td><td>Integer value with the maximum number of occurrences
of values. 1 typically. Or more for array types. 2147483647 means unlimited.  May be
null for a field generated by OGR</td></tr>
<tr><td>field_repetition_on_sequence</td><td>Boolean value to indicate if the
field is related to a &lt;sequence maxOccurs=">1 or unbounded"&gt; construct.
Only set when field_max_occurs is not 0 or 1.</td></tr>
<tr><td>field_default_value</td><td>Default value of the field, or null</td></tr>
<tr><td>field_fixed_value</td><td>Fixed value of the field, or null</td></tr>
<tr><td>field_category</td><td>Category of the field. May be REGULAR,
PATH_TO_CHILD_ELEMENT_NO_LINK, PATH_TO_CHILD_ELEMENT_WITH_LINK,
PATH_TO_CHILD_ELEMENT_WITH_JUNCTION_TABLE, GROUP or SWE_FIELD. May be null for a field
generated by OGR.</td></tr>
<tr><td>field_related_layer</td><td>Name of the child layer for
field_category != REGULAR</td></tr>
<tr><td>field_junction_layer</td><td>Name of the junction layer. Only
set if field_category is equal to PATH_TO_CHILD_ELEMENT_WITH_JUNCTION_TABLE</td></tr>
<tr><td>field_documentation</td><td>Documentation from the schema.</td></tr>
</table>

<p>Explanation of field_category values:</p>
<ul>
<li>REGULAR: the field is made from the value of an element or attribute that
is a direct child of the element that is the root of the layer considered.</li>
<li>PATH_TO_CHILD_ELEMENT_NO_LINK: A field declared with this category
is not instantiated as a OGR field of the layer 'layer_name'. It is merely there
to declare the relationship between the parent and child layers. This is when
a sub-element is of a complex type or a repeated sub-element of simple type that
does not match one of the OGR array types.</li>
<li>PATH_TO_CHILD_ELEMENT_WITH_LINK: the content of this field is the primary
key of a OGR feature of another layer. The field_related_layer field contains
the name of that linked layer.</li>
<li>PATH_TO_CHILD_ELEMENT_WITH_JUNCTION_TABLE: A field declared with this category
is not instantiated as a OGR field of the layer 'layer_name'. It is merely there
to declare the relationship between the parent and child layers. This is when
the link between the parent and child layer is done through a junction table
(case where the child layer is referenced by other parent layers).</li>
<li>GROUP: A field declared with this category
is not instantiated as a OGR field of the layer 'layer_name'. It is merely there
to declare the relationship between the parent and child layers. This is when
a layer uses XML schema group constructs with repeated cardinality.</li>
<li>SWE_FIELD: A field derived from special processing of swe:DataRecord or
swe:DataArray elements.</li>
</ul>

<h3>_ogr_layers_metadata layer</h3>

<p>This layer gives metadata about OGR layers.</p>

<p>Its structure is:
<br/>
<br/>
</p>
<table border="1">
<tr><th>Field name</th><th>Description</th></tr>
<tr><td>layer_name</td><td>Name of the layer</td></tr>
<tr><td>layer_xpath</td><td>XPath of the element that is used as the root
element for the layer. May be suffixed with ";extra=XXXX" for group constructs
or repeated sequences of repeated elements, so as to distinguish for the XPath
of their parent element. Will be null for junction tables or SWE_DATA_ARRAY
layers.</td></tr>
<tr><td>layer_category</td><td>Category of the layer. One of TOP_LEVEL_ELEMENT,
NESTED_ELEMENT, JUNCTION_TABLE or SWE_DATA_ARRAY</td></tr>
<tr><td>layer_pkid_name</td><td>Name of the primary key field. This is the
text attribute that uniquely identified a feature (in its layer). This is
the XML attribute/name of type xs:ID when it exists, otherwise a "ogr_pkid"
field is automatically created. Will be null for SWE_DATA_ARRAY layers.</td></tr>
<tr><td>layer_parent_pkid_name</td><td>Name of the field that is a foreign key
to the parent layer of this layer. Only set for a NESTED_ELEMENT layer.</td></tr>
<tr><td>layer_documentation</td><td>Documentation from the schema.</td></tr>
</table>

<h3>_ogr_layer_relationships layer</h3>

<p>This layer gives metadata about relationship between OGR layers.</p>

<p>Its structure is:
<br/>
<br/>
</p>
<table border="1">
<tr><th>Field name</th><th>Description</th></tr>
<tr><td>parent_layer</td><td>Name of the parent layer</td></tr>
<tr><td>parent_pkid</td><td>Name of the primary key of the parent layer</td></tr>
<tr><td>parent_element_name</td><td>Name of the XML element that links from the
parent to the child. Will be null when the child layer is due to group constructs
or repeated sequences of repeated elements of the parent.</td></tr>
<tr><td>child_layer</td><td>Name of the child layer</td></tr>
<tr><td>child_pkid</td><td>Name of the primary key of the child layer. Will
be null for SWE_DATA_ARRAY layers</td></tr>
</table>

<h3>_ogr_other_metadata layer</h3>

<p>This layer contains key / value pairs with different information.</p>

<p>Its structure is:
<br/>
<br/>
</p>
<table border="1">
<tr><th>Field name</th><th>Description</th></tr>
<tr><td>key</td><td>Name of the metadata item</td></tr>
<tr><td>value</td><td>Value of the metadata imtem</td></tr>
</table>

<p>Possible keys are :</p>
<ul>
<li>document_filename: Filename of the XML/GML file read.</li>
<li>configuration_filename: Filename of the XML configuration file used.</li>
<li>configuration_inlined: XML content of the configuration file.</li>
<li>namespace_uri_XX: URI of a namespace referenced by the schema(s).</li>
<li>namespace_location_XX: Location of a schema.</li>
<li>namespace_prefix_XX: Prefix of a namespace referenced by the schema(s).</li>
<li>gml_version: GML version, such as 2.1.2, 3.1.1 or 3.2.1</li>
</ul>

<h2>See Also</h2>

<ul>
<li> <a href="drv_gmlas.html">GMLAS</a>: main documentation page for GMLAS driver.</li>
</ul>

</body>
</html>
